package org.grottarossa.template.data.enums;

public enum EnumStatus 
{
	/**Indefinito.*/
	Undefined(0),
	/**Non ancora partito.*/
	NotStarted(1),		
	/**In corso.*/
	InProgress(2),
	/**Completato.*/
	Completed(3),	
	/**In attesa.*/
	Waiting(4),
	/**Rinviato.*/
	Deferred(5),
	/**Stato non contemplato dal sistema.*/
	Default(6);
				    
	EnumStatus(int val)
	{}
	
	
	public static EnumStatus getEnumValue(int target)
	{
		switch (target) {
		case 0:		
			return Undefined;
		case 1:		
			return NotStarted;
		case 2:		
			return InProgress;
		case 3:		
			return Completed;
		case 4:		
			return Waiting;
		case 5:		
			return Deferred;
		case 6:		
			return Default;				
		default:
			return Default;
		}
	}
	
	public boolean isUndefined()
	{
		switch (this) {
		case Undefined:			
			return true;		
		}
		return false;
	}
	public boolean isNotStarted()
	{
		switch (this) {
		case NotStarted:			
			return true;		
		}
		return false;
	}
	public boolean isInProgress()
	{
		switch (this) {
		case InProgress:			
			return true;		
		}
		return false;
	}
	public boolean isCompleted()
	{
		switch (this) {
		case Completed:			
			return true;		
		}
		return false;
	}
	public boolean isWaiting()
	{
		switch (this) {
		case Waiting:			
			return true;		
		}
		return false;
	}
	public boolean isDeferred()
	{
		switch (this) {
		case Deferred:			
			return true;		
		}
		return false;
	}
	public boolean isDefault()
	{
		switch (this) {
		case Default:			
			return true;		
		}
		return false;
	}
}
